package com.wdl.flink.test

import org.apache.flink.streaming.api.scala._


object WordCountByFlinkStream {

  def main(args: Array[String]): Unit = {

    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    val value: DataStream[String] = env.socketTextStream("192.168.0.104", 44444)
    val value1: DataStream[(String, Int)] = value.flatMap(_.split(" "))
      .map((_, 1))
      .keyBy(0)
      .sum(1)

    value1.print()

    env.execute("branch test 2")
    env.execute("master test 3")



  }
}
